import { Controller, Get, Post, Body, UsePipes } from '@nestjs/common';
import { UserService } from './user.service';
import { UserPipe } from '../utils/user.pipe';

@Controller('user')
export class UserController {
  constructor(
    private userService: UserService,
  ){
  }

  @Get()
  index() {
    return this.userService.getList()
  }

  @Post('list')
  @UsePipes( new UserPipe() )
  async list(@Body() body) {
    console.log(body)
    return this.userService.getList()
  }
}
